<template>
    <div class="miaoSaBox">
        <div class="top">
            <span style="font-size:15px">京东秒杀</span>
            <p class="DJS">
                <van-count-down :time="50000000">
                    <template #default="timeData">
                        <span class="block">{{ timeData.hours }}</span>
                        <span class="colon">:</span>
                        <span class="block">{{ timeData.minutes }}</span>
                        <span class="colon">:</span>
                        <span class="block">{{ timeData.seconds }}</span>
                    </template>
                </van-count-down>
            </p>
            <span style="color:red">爆款轮秒杀</span>
        </div>
        <ul class="bottom">
            <li v-for=" item in MiaoSaList" :key="item.proid">
                <img :src="item.img1" alt="">
                <p>￥{{item.sales}}</p>
            </li>
        </ul>

    </div>

</template>

<script setup lang="ts">
import { onMounted , ref } from 'vue';
import { MiaoSaApi } from '@/api/goods';
import type {MyMiaoSaItem} from '@/config/interface';

const MiaoSaList =ref<MyMiaoSaItem[]>([])

onMounted(async () => {
    const res = await MiaoSaApi({limitNum: 10})
    MiaoSaList.value = res.data
    // console.log(res  ,123);
    
})


</script>
<style scoped lang="scss">
.miaoSaBox {
    padding: 0 15px;
    // width: 95%;
    background-clip: padding-box;
    height: 155px;
    // background-color: rgb(255, 246, 247);
    background-color: #fff;
    border-radius: 10px;
    margin: 0 auto;

    >.top {
        background: url() no-repeat;
  
        height: 34px;
        background-size: 100% 30px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;

        >.DJS {
            position: absolute;
            left: 110px;

            .colon {
                display: inline-block;
                margin: 0 4px;
                color: #ee0a24;

            }

            .block {
                display: inline-block;
                width: 22px;
                color: #fff;
                font-size: 12px;
                text-align: center;
                background-color: #ee0a24;
                border-radius: 5px;
            }
        }
    };

    >.bottom {
        overflow-x: auto;
        margin-top: 12px;
        height: 78px;
        display: flex;
        background-color: #ffff;
     
        >li{
            width: 58px;
            border: 1px solid black;
            margin-left: 5px;
            flex-shrink:0 ;  //不压缩
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content:space-evenly;
           >img{
             width: 45px;
          height: 45px;
          display: block;
           }
           >p{
            color: #ee0a24;
            font-weight: 500;
            font-size: 12px;
          margin-top: 10px;
           }
                  
        }
    }
  

}
</style>